/*
* @File Name stepper_parameter.c
* @File Path M:\MAS2\PRM_Robotic_Arm\PRMCcode\coding\trajectory\stepper\stepper_parameter.c
* @Author: Ruige_Lee
* @Date:   2019-04-22 17:09:51
* @Last Modified by:   Ruige_Lee
* @Last Modified time: 2019-05-08 20:17:48
* @Email: 295054118@whut.edu.cn
* @page: https://whutddk.github.io/
*//*
* @File Name stepper_parameter.c
* @File Path M:\MAS2\PRM_Robotic_Arm\PRMCcode\coding\trajectory\stepper\stepper_parameter.c
* @Author: Ruige_Lee
* @Date:   2019-04-17 14:22:20
* @Last Modified by:   Ruige_Lee
* @Last Modified time: 2019-04-22 13:57:26
* @Email: 295054118@whut.edu.cn"
*/




#include <stdint.h>


#include "steppers.h"

#define PI (3.141592653)


const uint32_t posDiv[6] = {
	32,
	32,
	32,
	32,
	32,
	32
};

const uint32_t posInit[6] = {
	0x80000000,
	0x80000000,
	0x80000000,
	0x80000000,
	0x80000000,
	0x80000000
};

const uint32_t posMin[6] = {
	0x7FFF8170,	//( POS0_ZERO - (POS0_DIV * 900 * 27 / 18 / 4) )
	0x7FFFE54E,	//( POS1_ZERO - ( POS1_DIV * 250 * 123 / 18 / 8 ) )
	0x7FFFE0C0, //( POS2_ZERO - ( POS2_DIV * 400 * 45 / 18 / 4 ) )
	0x7FFF5038, //( POS3_ZERO - ( POS3_DIV * 1800 * 225 / 18 / 16  ) )
	0x7FFF7C2A, //( POS4_ZERO - ( POS4_DIV * 1350 * 225 / 18 / 16 ) )
	0x7FFFBF40  //( POS5_ZERO - ( POS5_DIV * 1800 * 5.18 / 18 ) )

};

const uint32_t posMax[6] = {
	0x80002A30,	//( POS0_ZERO + (POS0_DIV * 900 * 27 / 18 / 4) )
	0x8000DAE1, //( POS1_ZERO + ( POS1_DIV * 2050 * 123 / 18 / 8 ) )
	0x8000ABE0, //( POS2_ZERO + ( POS2_DIV * 2200 * 45 / 18 / 4 ) )
	0x8000AFC8, //( POS3_ZERO + ( POS3_DIV * 1800 * 225 / 18 / 16  ) )
	0x800083D6, //( POS4_ZERO + ( POS4_DIV * 1350 * 225 / 18 / 16 ) )
	0x800040C0  //( POS5_ZERO + ( POS5_DIV * 1800 * 5.18 / 18 ) )
};



//void radian2angle(float *radian, float *angle)
//{
//	uint8_t i = 0;
//	for ( i = 0; i < 6; i ++ )
//	{
//		angle[i] = radian[i] / PI * 180;
//	}
//}
//
//void angle2radian(float *angle,float *radian)
//{
//	uint8_t i = 0;
//	for ( i = 0; i < JOINT_COUNT; i ++ )
//	{
//		radian[i] = angle[i] / 180 * PI;
//	}
//}

